subroutine set_channel(lunit)
  use param
  use box_param,only:channel_n
  use box_param,only:bwidth
  use box_param,only:ch_width
  use box_param,only:ch_vol
  use box_param,only:total_volume
  implicit none

  integer,intent(in) :: lunit
  integer :: width,in1

  in1=1
  width=60

  call log_msg1(lunit,"")
  call log_msg1(lunit,"Channels of simulation box")
  call log_msg1(lunit,"")

  ! Write the header
  call drawline(lunit,in1,width)
  write(lunit,'(1x,20x,&
                6x,"x",6x,&
                6x,"y",6x,&
                6x,"z",6x)')
  call drawline(lunit,in1,width)

  write(lunit,'(1x,1x,"Number of channels",1x,&
                5x,i3.3,5x,&
                5x,i3.3,5x,&
                5x,i3.3,5x)') &
                channel_n(1),channel_n(2),channel_n(3)

  ! Width of channels
  ch_width(1)=bwidth(1)/real(channel_n(1))
  ch_width(2)=bwidth(2)/real(channel_n(2))
  ch_width(3)=bwidth(3)/real(channel_n(3))

  write(lunit,'(1x,1x,"Width of channels",2x,&
                1x,1pe11.5,1x,&
                1x,1pe11.5,1x,&
                1x,1pe11.5,1x)') &
                ch_width(1),ch_width(2),ch_width(3)

  ! Volume of channels
  ch_vol(1)=bwidth(2)*bwidth(3)*ch_width(1)
  ch_vol(2)=bwidth(1)*bwidth(3)*ch_width(2)
  ch_vol(3)=bwidth(1)*bwidth(2)*ch_width(3)

  write(lunit,'(1x,1x,"Volume of channels",1x,&
                1x,1pe11.5,1x,&
                1x,1pe11.5,1x,&
                1x,1pe11.5,1x)') &
                ch_vol(1),ch_vol(2),ch_vol(3)

  ! Total volume
  total_volume=bwidth(1)*bwidth(2)*bwidth(3)

  call drawline(lunit,in1,width)
  call log_msg1(lunit,"")
  
  return

end subroutine set_channel
